package com.hqyj.dao;


import com.hqyj.pojo.Info;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface InfoDao {

    @Select("SELECT provinceName,deadCount FROM info WHERE code < 478 AND areaName is NULL")
    List<Info> selectMap();

    @Select("SELECT provinceName,confirmCount FROM info WHERE code < 478 AND areaName is NULL\n" +
            "ORDER BY confirmCount DESC LIMIT 5")
    List<Info> selectBing();

    @Select("SELECT provinceName,curedCount FROM info WHERE code < 478 AND areaName is NULL\n" +
            "ORDER BY curedCount DESC LIMIT 5")
    List<Info> selectZhu();

    @Select("SELECT provinceName,deadCount FROM info WHERE code < 478 AND areaName is NULL\n" +
            "ORDER BY deadCount DESC LIMIT 3")
    List<Info> selectPai();

    @Select("SELECT provinceName FROM info WHERE code<478 AND areaName is NULL\n" +
            "ORDER BY confirmCount DESC LIMIT 1;")
    String selectLast();

    @Select("SELECT confirmCount,curedCount,deadCount FROM info WHERE provinceName=#{provinceName} and code < 478 AND areaName is NULL")
    List<Info> selectZhan(@Param("provinceName")String provinceName);

    @Select("SELECT provinceName FROM info WHERE code<478 AND areaName is NULL\n" +
            "ORDER BY confirmCount LIMIT 1;")
    String selectFast();

    @Select("SELECT areaName FROM info WHERE provinceName=#{provinceName} and code < 478 AND areaName!=''")
    List<String> selectCha(@Param("provinceName")String provinceName);

    @Select("SELECT confirmCount,curedCount,deadCount FROM info WHERE areaName=#{areaName} and code < 478")
    List<Info> selectShen(@Param("areaName")String areaName);

};
